import org.junit.Test;

import java.io.UnsupportedEncodingException;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;

public class Main {
    public static void main(String[] args) {

        /*System.out.println("请输入要转换的十进制的数：");
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        System.out.println("转换的十六进制的数为："+intToHex(n));*/

        byte b = 12;
        //char c = 'A';

        System.out.println(b);
        //System.out.println(c);

        String str = "中";
        char c = '中';
        System.out.println("char字符 中 二进制"+Integer.toBinaryString(c));
        try { System.out.println(str.getBytes("UTF-8").length);
            System.out.println(str.getBytes("UTF-16").length);
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }

    }

    private static String intToHex(int n) {
        //StringBuffer s = new StringBuffer();
        StringBuilder sb = new StringBuilder(8);
        String a;
        char []b = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
        while(n != 0){
            sb = sb.append(b[n%16]);
            n = n/16;
        }
        a = sb.reverse().toString();
        return a;
    }

    @Test
    public void test() throws UnknownHostException {
        /*Instant ins1 = new Date().toInstant();
        System.out.println(ins1);
        System.out.println("=========================");
        Calendar cal = Calendar.getInstance();
        Instant instant = cal.toInstant();
        System.out.println(instant);
        ZonedDateTime zdt = instant.atZone(cal.getTimeZone().toZoneId());
        System.out.println(zdt);
        LocalDateTime ldt = instant.atZone(cal.getTimeZone().toZoneId()).toLocalDateTime();
        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS");
        System.out.println(dtf.format(ldt));*/

        /*List<String> list = new ArrayList<>();
        list.add("daxigua");
        list.add("xiaoxigua");
        list.add("xiaomin");
        list.add("xiaojun");
        list.add("xiaohon");
        System.out.println(list.size());
        System.out.println(list.get(0));
        System.out.println(list.get(1));

        String[] a = new String[]{"a","d","v","r","t","t"};
        System.out.println(a.length);
        System.out.println(a[0]);
        System.out.println(a[2]);*/


        int a1 = 26;
        int a2 = 3;

        System.out.println(a1%a2);
        System.out.println(a1/a2);

    }
}
